package com.woniu.adopt_web.controller;

import com.woniu.adopt_web.service.OssUploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * 文件上传
 *  返回地址 或 字符串
 */
@RestController
@RequestMapping("oss")
public class OSSUploadController {
    @Autowired
    OssUploadService uploadService;

    @PostMapping("/upload")
    public String upload(@RequestParam("file") MultipartFile multipartFile){
        String result = uploadService.uploadImg(multipartFile);
        System.out.println(result);
        return result;
    }
}
